var date = new Date();
var nowYear = date.getFullYear();
var nowMonth = date.getMonth() + 1;
var nowDate = date.getDate();

for (var i = 0; i < 10; i++) {
	var year = nowYear + i;
	var str = "<option value=" + year + " name=" + year + ">" + year + "</option>";
	$("#year").append(str);
};

for (var i = 1; i <= 12; i++) {
	var str = "<option value=" + i + " name=" + i + ">" + i + "</option>";
	$("#month").append(str);
};
// 设置日期天数
function putDate() {
	var dates = new Date($("#year").val(), $("#month").val(), 0).getDate();
	for (var i = 1; i <= dates; i++) {
		var str = "<option value=" + i + " name=" + i + ">" + i + "</option>";
		$("#date").append(str);
	};
};
putDate();
$("#year,#month").change(function() {
	$("#date").html("");
	putDate();
});
$("#month").find("option[value=" + nowMonth + "]").attr("selected", "selected");
$("#date").find("option[value=" + nowDate + "]").attr("selected", "selected");